﻿function InvestmentViewModel(model) {
    var selfModel = this;
    var isMain = false;

    selfModel.Controller = "Investment";
    selfModel.StartPage = selfModel.Controller + "Create";

    ko.mapping.fromJS(model, {}, selfModel);

    selfModel.prototype = new CRUDViewModel(selfModel);

    Main.State.CurrentPage.subscribe(function (newValue) {
        if(newValue == selfModel.Controller)
        {
            Main.Page.ChangeHash(selfModel.StartPage);
        }
    });

    selfModel.Init(isMain);
}